<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org" xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout" layout:decorator="layout/admin">
<head>
  <title>首页</title>
</head>
<body>
<main layout:fragment="content">
  <article class="container" style="padding: 3% 0 2%;">
    <header class="row">
      <blockquote class="flow-text left" th:text="${header}">Header</blockquote>
      </header>
    <section class="row">
      <div class="col s12">
        <table class="striped bordered centered" th:if="${topics.size() != 0}">
          <thead>
          <tr>
            <th>集卡活动标题</th>
            <th>查看详情</th>
          </tr>
          </thead>

          <form  th:action="@{'/admin/manage/search'}" method="post">
            <div class="row">
              <div class="col s12 center">
                <input type="text" name="title" placeholder="请输入活动标题"/>
                <button class="btn waves-effect waves-light btn-large"
                        type="submit" name="on">搜索</button>
              </div>
            </div>
          </form>
          <tbody>
          <th:block th:each="topic : ${topics}">
            <tr>
              <td th:text="${topic.getTitle()}">Topic's title</td>
              <td>
                <a th:href="@{'/all/'  + ${topic.getId()}}" class="btn btn-floating pulse">
                  <i class="material-icons">arrow_forward</i>
                </a>
              </td>
            </tr>
          </th:block>
          </tbody>
        </table>
      </div>
    </section>
  </article>
</main>
</body>
</html>